package com.niuwa.p2p.action.loanclaim.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.niuwa.p2p.core.utils.StringUtil;
import com.niuwa.p2p.vo.claim.LoanClaimVo;

/**
 * 2015年4月3日
 * 
 * @author futianliang
 */
public class LoanClaimWithProdModel {
	public LoanClaimWithProdModel(LoanClaimVo vo) {
		this.productCode = vo.getProductCode();
		this.productName = vo.getProductName();
		this.projectNOandName = vo.getProjectNo();
		if (!StringUtil.isEmpty(vo.getProjectName())) {
			projectNOandName =projectNOandName+","+vo.getProjectName();
		}
		this.projectName = vo.getProjectName();
		this.projectNo = vo.getProjectNo();
		this.projectType = vo.getProjectType();
		this.loanAmount = String.format("%,.2f", vo.getLoanAmount());
		this.remainClaimAmount = String.format("%,.2f", vo.getRemainClaimAmount());
		String type = "";
		if ("M".equals(vo.getTimeType())) {
			type = "个月";
		} else if ("D".equals(vo.getTimeType())) {
			type = "天";
		} else {
			type = "年";
		}
		this.loanTerm = vo.getLoanTerm() + type;
		this.remainTerm = vo.getRemainTerm();
		this.interestRate = String.format("%.2f%%", Double.parseDouble(String.valueOf(vo.getInterestRate())));
		this.productExpireTime = vo.getProductExpireTime();
		this.nextRepayDate = vo.getNextRepayDate();
		this.isOverdue = "Y".equals(vo.getIsOverdue()) ? "是" : "否";
		this.isTrans = "Y".equals(vo.getIsTrans()) ? "是" : "否";
	}

	private java.lang.String productCode;
	/**
	 * 产品名称
	 * 
	 */
	private String projectType;
	private String projectNo;
	private String projectName;
	public String getProjectType() {
		return projectType;
	}

	public void setProjectType(String projectType) {
		this.projectType = projectType;
	}

	public String getProjectNo() {
		return projectNo;
	}

	public void setProjectNo(String projectNo) {
		this.projectNo = projectNo;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	private java.lang.String productName;

	private java.lang.String projectNOandName;

	/**
	 * 借款金额
	 * 
	 */
	private String loanAmount;
	/**
	 * 债权余额
	 * 
	 */
	private String remainClaimAmount;

	public String getLoanAmount() {
		return loanAmount;
	}

	public void setLoanAmount(String loanAmount) {
		this.loanAmount = loanAmount;
	}

	public String getRemainClaimAmount() {
		return remainClaimAmount;
	}

	public void setRemainClaimAmount(String remainClaimAmount) {
		this.remainClaimAmount = remainClaimAmount;
	}

	/**
	 * 借款期限
	 * 
	 */
	private String loanTerm;
	/**
	 * 剩余期限
	 * 
	 */
	private Integer remainTerm;

	/**
	 * 借款利率
	 * 
	 */
	private String interestRate;

	/**
	 * 最近还款日
	 * 
	 */
	@JSONField(format = "yyyy-MM-dd")
	private java.util.Date nextRepayDate;

	/**
	 * 是否逾期
	 * 
	 */
	private java.lang.String isOverdue;
	/**
	 * 产品到期日
	 * 
	 */
	@JSONField(format = "yyyy-MM-dd")
	private java.util.Date productExpireTime;
	/**
	 * 是否允许转让
	 * 
	 */
	private java.lang.String isTrans;

	public java.lang.String getProductCode() {
		return productCode;
	}

	public void setProductCode(java.lang.String productCode) {
		this.productCode = productCode;
	}

	public java.lang.String getProductName() {
		return productName;
	}

	public void setProductName(java.lang.String productName) {
		this.productName = productName;
	}

	public java.lang.String getProjectNOandName() {
		return projectNOandName;
	}

	public void setProjectNOandName(java.lang.String projectNOandName) {
		this.projectNOandName = projectNOandName;
	}

	public String getLoanTerm() {
		return loanTerm;
	}

	public void setLoanTerm(String loanTerm) {
		this.loanTerm = loanTerm;
	}

	public Integer getRemainTerm() {
		return remainTerm;
	}

	public void setRemainTerm(Integer remainTerm) {
		this.remainTerm = remainTerm;
	}

	public String getInterestRate() {
		return interestRate;
	}

	public void setInterestRate(String interestRate) {
		this.interestRate = interestRate;
	}

	public java.util.Date getNextRepayDate() {
		return nextRepayDate;
	}

	public void setNextRepayDate(java.util.Date nextRepayDate) {
		this.nextRepayDate = nextRepayDate;
	}

	public java.lang.String getIsOverdue() {
		return isOverdue;
	}

	public void setIsOverdue(java.lang.String isOverdue) {
		this.isOverdue = isOverdue;
	}

	public java.util.Date getProductExpireTime() {
		return productExpireTime;
	}

	public void setProductExpireTime(java.util.Date productExpireTime) {
		this.productExpireTime = productExpireTime;
	}

	public java.lang.String getIsTrans() {
		return isTrans;
	}

	public void setIsTrans(java.lang.String isTrans) {
		this.isTrans = isTrans;
	}

}
